#include "Form.h"

namespace Zaf {
namespace Mwl {



HWND Form::CreateConcreteWindow() {

	unsigned int x;
	unsigned int y;
	GetPosition(x, y);

	unsigned int width;
	unsigned int height;
	GetSize(width, height);

	return CreateWindowEx(
		GetExStyle(),
		L"#32770",
		GetText().c_str(),
		GetStyle() | WS_OVERLAPPEDWINDOW,
		x,
		y,
		width,
		height,
		GetParentOrOwner(),
		NULL,
		GetModuleHandle(NULL),
		0
	);
}



bool Form::HasTitleBar() const {
	return ! HasStyle(WS_POPUP);
}
void Form::HasTitleBar(bool value) {

	if (value == true) {
		SetStyle(GetStyle() & ~WS_POPUP);
		SetStyle(GetStyle() | WS_OVERLAPPED | WS_CAPTION | WS_BORDER);
	}
	else {
		SetStyle(GetStyle() & ~WS_OVERLAPPED & ~WS_CAPTION & ~WS_BORDER);
		SetStyle(GetStyle() | WS_POPUP);
	}
}




}
}